package com.ruoyi.psi.quality.analysis.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.produce.process.defective.domain.Defective;
import com.ruoyi.psi.quality.analysis.domain.QualityAnalysis;
import com.ruoyi.psi.quality.analysis.service.IQualityAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/psi/quality/analysis")
@Api(value = "质检分析", tags = "质检分析接口")
public class QualityAnalysisController extends BaseController {
    @Autowired
    private IQualityAnalysisService qualityAnalysisService;

    /**
     * 获取质检分析
     * @param defective
     * @return
     */
    @ApiOperation("获取质检分析")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody Defective defective) {
        startPage();
        List<QualityAnalysis> qualityAnalysisList = qualityAnalysisService.selectQualityAnalysis(defective);
        return getDataTable(qualityAnalysisList);
    }
}
